home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / drawfram / readme.txt < prev   
Encoding:
Text File  |  1994-08-13  |  2.9 KB  |  67 lines

  1. Stephen W. Cocks - America Online Stephen105 - Compuserve 71604,163
  2.  
  3. These Visual Basic files are in the PUBLIC DOMAIN.  They were compressed
  4. using PKWARE's pkzip.exe version 2.04g (registered).  The files included
  5. are:
  6.      drawfram.frm
  7.      drawfram.mak
  8.      readme.txt
  9.  
  10. This program was written using Visual Basic 3.0 Professional Edition, but
  11. DOES NOT REQUIRE THE PROFESSIONAL EDITION.
  12.  
  13. DrawFrameOn (the original) can be found in Richard Mansfield's book, "The
  14. Visual Guide to Visual Basic For Windows" on page 514, under LINE METHOD.
  15. I endorse Mr. Mansfield's book.  Unlike other books that are organized
  16. Alphabetically by Visual Basic's Controls, Events, Functions, Methods,
  17. Properties, etc., this book punctuates its narrative with little applets
  18. that are more than just useful, they are thought provoking. Of the twelve
  19. manuals I have on VB, this one is the most dog eared.
  20.  
  21. When I tried to make Mr. Mansfield's DrawFrameOn put a frame adjacent to a
  22. control (per his instructions), it left a one pixel gap on the right side
  23. and on the bottom.  This isn't noticeable when the frame is more than (lets
  24. say) ten pixels away from the control, but it certainly won't do when it is
  25. supposed to abut the control.
  26.  
  27. When you want to find the right-most position occupied by a control where
  28. you are given its left-most position and its width, you must add the left
  29. postion and the width and subtract one.
  30.  
  31.        right-most position = (Control.Left + Control.Width) - 1
  32.  
  33. For example: Your command button's Left property is 3 and its width is 5, so
  34. it occupies positions 3, 4, 5, 6, 7. To find its right most position, you
  35. add its Left, 3, and Width, 5, and subtract 1.
  36.  
  37.        7 = 3 + 5 - 1
  38.  
  39. I also added colors to the large box Mr. Mansfield suggests drawing before
  40. adding the lines.  When you draw the larger frames first and make the color
  41. of the smallest frame 7, or Light Gray, you can get the effect of filling
  42. frames with color. Some combinations of colors and frame styles "don't work"
  43. in that they aren't pleasing to the eye.
  44.  
  45. DrawFrameOn (TopLeftControl As Control, BottomRightControl As Control, Style
  46.              As String, FrameOffset As Integer, Color As Integer)
  47.  
  48. Pass DrawFrameOn the names of the controls, "Raised" or "Inset", how many
  49. pixels you want from the controls border to the frame, and the color
  50. expressed as the integer used by QBColor(n).
  51.  
  52. The TWIPS = Screen.TwipsPerPixelX instruction gathers an approximation of
  53. the twips per pixel (or so the manuals say) for your monitor.  On my 15"
  54. SVGA monitor that measurement comes out 15 twips per pixel.
  55.  
  56. This form has OPTION EXPICIT set so you must declare your variables.
  57.  
  58. You may draw as many frames as you like varying their distance from each
  59. other and the colors inbetween to create the effect of ornate picture
  60. frames.  I've found the dark colors are especially good for this kind of
  61. work.
  62.  
  63. Stephen W. Cocks Compuserve 71604,163
  64.  
  65.  
  66.  
  67.